package JavaSE.d5;
//斐波那契序列0+1+1+2+3+5+8+13+21+34 = 88
//        0 1  1   2  3
//        x y x+y
//          x  y   x+y
public class Test15 {
    public static void main(String[] args) {
        int x=0;
        int y=1;
        int sum=0;
        for (int i = 0; i < 10; i++) {
            int t=x+y;
            sum+=x;
            x=y;
            y=t;
            System.out.println(x);
        }
        System.out.println(sum);
    }
}
